package partage;

public class Main {
	private Symbole main;
	public Main() {
		this.main = Symbole.Vide;
	}
	/**
	 * @param main
	 */
	public Main(Symbole main) {
		this.main = main;
	}
	public Main(String main){
		this.main=Symbole.valueOf(main);
	}
	public Symbole getMain() {
		return main;
	}
	public void setMain(Symbole main) {
		this.main = main;
	}
	public boolean equals(Symbole main){
		return this.main==main;
	}
	public void passMain(){
		if(main==Symbole.Croix)
			main=Symbole.Rond;
		else main=Symbole.Croix;
	}
	public String toString(){
		return "Main : "+main;
	}
	public static Main valueOf(String main){
		if(main.indexOf("Main")>=0){
			String chaine=main.replaceAll("Main : ", "");
			return new Main(Symbole.valueOf(chaine.replaceAll(" ", "")));
		}
		return null;
	}
}
